package com.yq.day74.daili.dongtai;

import com.yq.day74.daili.jingtai.JingTian;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;

/**
 * @author 3307235355@qq.com
 * @description
 * @since 2022/07/04 16:38
 */
public class JingTianInvocationHandler implements InvocationHandler {
    //委托的对象
    JingTian delegate = new JingTian();
    @Override
    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
        // 代理的对象 执行的方法  参数
        System.out.println("鸡蛋");
        Object invoke = method.invoke(delegate, args);
        System.out.println("奶茶");
        return invoke;
    }
}
